package com.ruoyi.examApproval.service.impl;

import com.ruoyi.examApproval.domain.Approval;
import com.ruoyi.examApproval.mapper.ApprovalMapper;
import com.ruoyi.examApproval.service.IApprovalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ApprovalService implements IApprovalService
{
    @Autowired
    private ApprovalMapper ApprovalMapper;

    public Approval selectApprovalById(Long id)
    {
        return ApprovalMapper.selectApprovalById(id);
    }

    // 根据candidateId查询
    public Approval selectApprovalByCandidateId(String candidateId){
        return ApprovalMapper.selectApprovalByCandidateId(candidateId);
    }

    public List<Approval> selectApprovalList()
    {
        return ApprovalMapper.selectApprovalList();
    }

    public int insertApproval(Approval approval)
    {
        return ApprovalMapper.insertApproval(approval);
    }

    public int updateApproval(Approval approval)
    {
        return ApprovalMapper.updateApproval(approval);
    }

    public int deleteApprovalById(Long id)
    {
        return ApprovalMapper.deleteApprovalById(id);
    }
}